//
//  IWIconButton.m
//  minshengbank
//
//  Created by mac on 16/10/27.
//  Copyright © 2016年 王. All rights reserved.
//

#import "IWIconButton.h"
@interface IWIconButton (){
    CGFloat top;
    CGFloat size;
    CGFloat width;
}

@end
@implementation IWIconButton

-(id)initWithCoder:(NSCoder *)aDecoder{
    if (self) {
        self=[super initWithCoder:aDecoder];
        if (self.tag==1004||self.tag==1003) {
            width=100;
        }else{
            width=100;
            
        }
            size=1.;
        self.titleLabel.textAlignment=NSTextAlignmentCenter;
        
    }
    return self;
    
}
-(instancetype)initWithFrame:(CGRect)frame{
    self=[super initWithFrame:frame];
    if (self) {
        
        self.titleLabel.textAlignment=NSTextAlignmentCenter;
    }
    return self;
    
}
-(void)setHighlighted:(BOOL)highlighted{
    
}
/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */
-(CGRect)imageRectForContentRect:(CGRect)contentRect{
      top=(self.height-width*size-20)/2;
    return CGRectMake(self.frame.size.width/2.-width/2., top, width, width*size);
    
}
-(CGRect)titleRectForContentRect:(CGRect)contentRect{
      top=(self.height-width*size-20)/2;
    return CGRectMake(0,top+width*size+10,self.frame.size.width ,20);
}
@end
